3.2.59 \(\int \tanh (c+d x) (a+b \tanh ^2(c+d x))^3 \, dx\) [159]

Optimal. Leaf size=83 \[ \frac {(a+b)^3 \log (\cosh (c+d x))}{d}-\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d} \]

[Out]

(a+b)^3*ln(cosh(d*x+c))/d-1/2*b*(a+b)^2*tanh(d*x+c)^2/d-1/4*(a+b)*(a+b*tanh(d*x+c)^2)^2/d-1/6*(a+b*tanh(d*x+c)
^2)^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3751, 455, 45} \begin {gather*} -\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d}+\frac {(a+b)^3 \log (\cosh (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]*(a + b*Tanh[c + d*x]^2)^3,x]

[Out]

((a + b)^3*Log[Cosh[c + d*x]])/d - (b*(a + b)^2*Tanh[c + d*x]^2)/(2*d) - ((a + b)*(a + b*Tanh[c + d*x]^2)^2)/(
4*d) - (a + b*Tanh[c + d*x]^2)^3/(6*d)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 455

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx &=\frac {\text {Subst}\left (\int \frac {x \left (a+b x^2\right )^3}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {(a+b x)^3}{1-x} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (-b (a+b)^2+\frac {(a+b)^3}{1-x}-b (a+b) (a+b x)-b (a+b x)^2\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {(a+b)^3 \log (\cosh (c+d x))}{d}-\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 76, normalized size = 0.92 \begin {gather*} -\frac {-2 (a+b)^3 \log (\cosh (c+d x))+b (a+b)^2 \tanh ^2(c+d x)+\frac {1}{2} (a+b) \left (a+b \tanh ^2(c+d x)\right )^2+\frac {1}{3} \left (a+b \tanh ^2(c+d x)\right )^3}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]*(a + b*Tanh[c + d*x]^2)^3,x]

[Out]

-1/2*(-2*(a + b)^3*Log[Cosh[c + d*x]] + b*(a + b)^2*Tanh[c + d*x]^2 + ((a + b)*(a + b*Tanh[c + d*x]^2)^2)/2 +
(a + b*Tanh[c + d*x]^2)^3/3)/d

________________________________________________________________________________________

Maple [A]
time = 0.39, size = 151, normalized size = 1.82

method result size
derivativedivides \(\frac {\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (1+\tanh \left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a^{2} b \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}-\frac {b^{3} \left (\tanh ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{3} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}}{d}\) \(151\)
default \(\frac {\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (1+\tanh \left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a^{2} b \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}-\frac {b^{3} \left (\tanh ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{3} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}}{d}\) \(151\)
risch \(-a^{3} x -3 a^{2} b x -3 a \,b^{2} x -b^{3} x -\frac {2 a^{3} c}{d}-\frac {6 a^{2} b c}{d}-\frac {6 a \,b^{2} c}{d}-\frac {2 b^{3} c}{d}+\frac {2 b \,{\mathrm e}^{2 d x +2 c} \left (9 a^{2} {\mathrm e}^{8 d x +8 c}+18 a b \,{\mathrm e}^{8 d x +8 c}+9 b^{2} {\mathrm e}^{8 d x +8 c}+36 a^{2} {\mathrm e}^{6 d x +6 c}+54 a b \,{\mathrm e}^{6 d x +6 c}+18 b^{2} {\mathrm e}^{6 d x +6 c}+54 a^{2} {\mathrm e}^{4 d x +4 c}+72 a b \,{\mathrm e}^{4 d x +4 c}+34 b^{2} {\mathrm e}^{4 d x +4 c}+36 a^{2} {\mathrm e}^{2 d x +2 c}+54 a b \,{\mathrm e}^{2 d x +2 c}+18 b^{2} {\mathrm e}^{2 d x +2 c}+9 a^{2}+18 a b +9 b^{2}\right )}{3 d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{6}}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a^{3}}{d}+\frac {3 \ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a^{2} b}{d}+\frac {3 \ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a \,b^{2}}{d}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) b^{3}}{d}\) \(353\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)*(a+b*tanh(d*x+c)^2)^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/2*(-a^3-3*a^2*b-3*a*b^2-b^3)*ln(1+tanh(d*x+c))-3/2*a*b^2*tanh(d*x+c)^2-3/2*a^2*b*tanh(d*x+c)^2-3/4*a*b^
2*tanh(d*x+c)^4-1/6*b^3*tanh(d*x+c)^6-1/2*(a^3+3*a^2*b+3*a*b^2+b^3)*ln(tanh(d*x+c)-1)-1/2*b^3*tanh(d*x+c)^2-1/
4*b^3*tanh(d*x+c)^4)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (77) = 154\).
time = 0.51, size = 351, normalized size = 4.23 \begin {gather*} \frac {1}{3} \, b^{3} {\left (3 \, x + \frac {3 \, c}{d} + \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, {\left (9 \, e^{\left (-2 \, d x - 2 \, c\right )} + 18 \, e^{\left (-4 \, d x - 4 \, c\right )} + 34 \, e^{\left (-6 \, d x - 6 \, c\right )} + 18 \, e^{\left (-8 \, d x - 8 \, c\right )} + 9 \, e^{\left (-10 \, d x - 10 \, c\right )}\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}}\right )} + 3 \, a b^{2} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + 3 \, a^{2} b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a^{3} \log \left (\cosh \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)*(a+b*tanh(d*x+c)^2)^3,x, algorithm="maxima")

[Out]

1/3*b^3*(3*x + 3*c/d + 3*log(e^(-2*d*x - 2*c) + 1)/d + 2*(9*e^(-2*d*x - 2*c) + 18*e^(-4*d*x - 4*c) + 34*e^(-6*
d*x - 6*c) + 18*e^(-8*d*x - 8*c) + 9*e^(-10*d*x - 10*c))/(d*(6*e^(-2*d*x - 2*c) + 15*e^(-4*d*x - 4*c) + 20*e^(
-6*d*x - 6*c) + 15*e^(-8*d*x - 8*c) + 6*e^(-10*d*x - 10*c) + e^(-12*d*x - 12*c) + 1))) + 3*a*b^2*(x + c/d + lo
g(e^(-2*d*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c))/(d*(4*e^(-2*d*x - 2*c)
+ 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) + 3*a^2*b*(x + c/d + log(e^(-2*d*x - 2*c)
+ 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1))) + a^3*log(cosh(d*x + c))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 4298 vs. \(2 (77) = 154\).
time = 0.46, size = 4298, normalized size = 51.78 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)*(a+b*tanh(d*x+c)^2)^3,x, algorithm="fricas")

[Out]

-1/3*(3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^12 + 36*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x
 + c)*sinh(d*x + c)^11 + 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*sinh(d*x + c)^12 - 18*(a^2*b + 2*a*b^2 + b^3 -
(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^10 + 18*(11*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x +
c)^2 - a^2*b - 2*a*b^2 - b^3 + (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*sinh(d*x + c)^10 + 60*(11*(a^3 + 3*a^2*b +
 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^3 - 3*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x
 + c))*sinh(d*x + c)^9 - 9*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^
8 + 9*(165*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^4 - 8*a^2*b - 12*a*b^2 - 4*b^3 + 5*(a^3 + 3*a^2*b
 + 3*a*b^2 + b^3)*d*x - 90*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^2)*sinh
(d*x + c)^8 + 72*(33*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^5 - 30*(a^2*b + 2*a*b^2 + b^3 - (a^3 +
3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^3 - (8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3
)*d*x)*cosh(d*x + c))*sinh(d*x + c)^7 - 4*(27*a^2*b + 36*a*b^2 + 17*b^3 - 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d
*x)*cosh(d*x + c)^6 + 4*(693*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^6 - 945*(a^2*b + 2*a*b^2 + b^3
- (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^4 - 27*a^2*b - 36*a*b^2 - 17*b^3 + 15*(a^3 + 3*a^2*b + 3*
a*b^2 + b^3)*d*x - 63*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^2)*si
nh(d*x + c)^6 + 24*(99*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^7 - 189*(a^2*b + 2*a*b^2 + b^3 - (a^3
 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^5 - 21*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2
 + b^3)*d*x)*cosh(d*x + c)^3 - (27*a^2*b + 36*a*b^2 + 17*b^3 - 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*
x + c))*sinh(d*x + c)^5 - 9*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)
^4 + 3*(495*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^8 - 1260*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b
 + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^6 - 210*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d
*x)*cosh(d*x + c)^4 - 24*a^2*b - 36*a*b^2 - 12*b^3 + 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x - 20*(27*a^2*b + 3
6*a*b^2 + 17*b^3 - 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^2)*sinh(d*x + c)^4 + 4*(165*(a^3 + 3*
a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^9 - 540*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)
*cosh(d*x + c)^7 - 126*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^5 -
20*(27*a^2*b + 36*a*b^2 + 17*b^3 - 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^3 - 9*(8*a^2*b + 12*a
*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c))*sinh(d*x + c)^3 + 3*(a^3 + 3*a^2*b + 3*a*
b^2 + b^3)*d*x - 18*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^2 + 6*(33*(a^3
 + 3*a^2*b + 3*a*b^2 + b^3)*d*x*cosh(d*x + c)^10 - 135*(a^2*b + 2*a*b^2 + b^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3
)*d*x)*cosh(d*x + c)^8 - 42*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)
^6 - 10*(27*a^2*b + 36*a*b^2 + 17*b^3 - 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x)*cosh(d*x + c)^4 - 3*a^2*b - 6*
a*b^2 - 3*b^3 + 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*d*x - 9*(8*a^2*b + 12*a*b^2 + 4*b^3 - 5*(a^3 + 3*a^2*b + 3*a
*b^2 + b^3)*d*x)*cosh(d*x + c)^2)*sinh(d*x + c)^2 - 3*((a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^12 + 12*(
a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)*sinh(d*x + c)^11 + (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*sinh(d*x + c)^
12 + 6*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^10 + 6*(a^3 + 3*a^2*b + 3*a*b^2 + b^3 + 11*(a^3 + 3*a^2*b
 + 3*a*b^2 + b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^10 + 20*(11*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^3 +
 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c))*sinh(d*x + c)^9 + 15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*
x + c)^8 + 15*(33*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^4 + a^3 + 3*a^2*b + 3*a*b^2 + b^3 + 18*(a^3 +
3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^8 + 24*(33*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x +
c)^5 + 30*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^3 + 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c))*s
inh(d*x + c)^7 + 20*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^6 + 4*(231*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*c
osh(d*x + c)^6 + 315*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^4 + 5*a^3 + 15*a^2*b + 15*a*b^2 + 5*b^3 + 1
05*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^6 + 24*(33*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*c
osh(d*x + c)^7 + 63*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^5 + 35*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(
d*x + c)^3 + 5*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c))*sinh(d*x + c)^5 + 15*(a^3 + 3*a^2*b + 3*a*b^2 +
b^3)*cosh(d*x + c)^4 + 15*(33*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cosh(d*x + c)^8 + 84*(a^3 + 3*a^2*b + 3*a*b^2 +
b^3)*cosh(d*x + c)^6 + 70*(a^3 + 3*a^2*b + 3*a*...

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 211 vs. \(2 (71) = 142\).
time = 0.21, size = 211, normalized size = 2.54 \begin {gather*} \begin {cases} a^{3} x - \frac {a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + 3 a^{2} b x - \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a^{2} b \tanh ^{2}{\left (c + d x \right )}}{2 d} + 3 a b^{2} x - \frac {3 a b^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a b^{2} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {3 a b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} + b^{3} x - \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{3} \tanh ^{6}{\left (c + d x \right )}}{6 d} - \frac {b^{3} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right )^{3} \tanh {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)*(a+b*tanh(d*x+c)**2)**3,x)

[Out]

Piecewise((a**3*x - a**3*log(tanh(c + d*x) + 1)/d + 3*a**2*b*x - 3*a**2*b*log(tanh(c + d*x) + 1)/d - 3*a**2*b*
tanh(c + d*x)**2/(2*d) + 3*a*b**2*x - 3*a*b**2*log(tanh(c + d*x) + 1)/d - 3*a*b**2*tanh(c + d*x)**4/(4*d) - 3*
a*b**2*tanh(c + d*x)**2/(2*d) + b**3*x - b**3*log(tanh(c + d*x) + 1)/d - b**3*tanh(c + d*x)**6/(6*d) - b**3*ta
nh(c + d*x)**4/(4*d) - b**3*tanh(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tanh(c)**2)**3*tanh(c), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 216 vs. \(2 (77) = 154\).
time = 0.53, size = 216, normalized size = 2.60 \begin {gather*} -\frac {3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} {\left (d x + c\right )} - 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {2 \, {\left (9 \, {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} e^{\left (10 \, d x + 10 \, c\right )} + 18 \, {\left (2 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} e^{\left (8 \, d x + 8 \, c\right )} + 2 \, {\left (27 \, a^{2} b + 36 \, a b^{2} + 17 \, b^{3}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 18 \, {\left (2 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 9 \, {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{6}}}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)*(a+b*tanh(d*x+c)^2)^3,x, algorithm="giac")

[Out]

-1/3*(3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*(d*x + c) - 3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*log(e^(2*d*x + 2*c) + 1)
 - 2*(9*(a^2*b + 2*a*b^2 + b^3)*e^(10*d*x + 10*c) + 18*(2*a^2*b + 3*a*b^2 + b^3)*e^(8*d*x + 8*c) + 2*(27*a^2*b
 + 36*a*b^2 + 17*b^3)*e^(6*d*x + 6*c) + 18*(2*a^2*b + 3*a*b^2 + b^3)*e^(4*d*x + 4*c) + 9*(a^2*b + 2*a*b^2 + b^
3)*e^(2*d*x + 2*c))/(e^(2*d*x + 2*c) + 1)^6)/d

________________________________________________________________________________________

Mupad [B]
time = 1.25, size = 123, normalized size = 1.48 \begin {gather*} x\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (3\,a^2\,b+3\,a\,b^2+b^3\right )}{2\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}{d}-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^4\,\left (b^3+3\,a\,b^2\right )}{4\,d}-\frac {b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^6}{6\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(c + d*x)*(a + b*tanh(c + d*x)^2)^3,x)

[Out]

x*(3*a*b^2 + 3*a^2*b + a^3 + b^3) - (tanh(c + d*x)^2*(3*a*b^2 + 3*a^2*b + b^3))/(2*d) - (log(tanh(c + d*x) + 1
)*(3*a*b^2 + 3*a^2*b + a^3 + b^3))/d - (tanh(c + d*x)^4*(3*a*b^2 + b^3))/(4*d) - (b^3*tanh(c + d*x)^6)/(6*d)

________________________________________________________________________________________